package com.joseph.test;

/**
 * @description 
 * @author Joseph_Mok
 * @date 2016年4月28日下午2:59:04
 */
public class SynDemo {

	public static void main(String[] args) {
		final Object object = new Object();
		Thread t1 = new Thread() {
			public void run() {
				synchronized (object) {
					System.out.println("T1 is running...");
				}
				try {
					object.wait();
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				System.out.println("T1 is end...");
			}
		};
		
		Thread t2 = new Thread() {
			public void run() {
				synchronized (object) {
					System.out.println("T2 end...");
				}
			}
		};
		t1.start();
		t2.start();
	}
}
